<layout name="Index/layout" />

<div class="box-form form-edit">
    <div class="tit">
        <notempty name="_tit">{$_tit}</notempty>
    </div>
    <div class="con">

<form class="AjaxForm" data-action="{:U()}" method="post" >
    <table class="bordered color">
        <foreach name="_input" item="v">
        <if condition="$v['type'] == 'hidden'">
            <input type="hidden" name="{$v.name}" value="{$v.value}" {$v.attr}>
        <else/>
            <tr>
                <th width="15%">{$v.title}</th>
                <td width="85%">
                <switch name="v.type">
                    <case value="textarea">
                        <textarea name="{$v.name}" datatype="{$v.valid}" tip="{$v.tip}" {$v.attr} >{$v.value}</textarea>
                    </case>
                    <case value="select">
                        <select name="{$v.name}" tip="{$v.tip}" {$v.attr}>
                        <foreach name="v.param" item="vv" key="kk">
                            <option value="{$kk}" <eq name="v.value" value="$kk">selected</eq> >{$vv}</option>
                        </foreach>
                        </select>
                    </case>
                    <case value="radio">
                        <foreach name="v.param" item="vv" key="kk">
                        <input type="radio" id="{$v.name}_{$kk}" name="{$v.name}" value="{$kk}" <eq name="v.value" value="$kk">checked</eq> {$v.attr}><label for="{$v.name}_{$kk}">{$vv}</label>
                        </foreach>
                    </case>
                    <case value="datetime">
                        {:W('Datetime/dateTime',array($v['name'],$v['value']))}
                    </case>
                    <case value="date">
                        {:W('Datetime/date',array($v['name'],$v['value']))}
                    </case>
                    <case value="editor">
                        {:W('Ueditor/editor',array($v['name'],$v['value']))}
                    </case>
                    <case value="image">
                        {:W('Uploadify/thumb',array($v['name'],$v['value']))}
                    </case>
                    <case value="file">
                        {:W('Uploadify/file',array($v['name'],$v['value']))}
                    </case>
                    <default />
                        <input type="text" name="{$v.name}" value="{$v.value}" datatype="{$v.valid}" tip="{$v.tip}" {$v.attr}>
                </switch>
                </td>
            </tr>
        </if>
        </foreach>
        <tr>
            <th></th>
            <td><input type="submit" class="btn-big btn-blue" value="提交"></td>
        </tr>
    </table>
</form>

    </div>
</div>

<script type="text/javascript">
seajs.use(['ajax'],function(ajax){
    ajax.get();
    ajax.confirm();
    ajax.html();
    ajax.valid();
});
</script>
